package special;

import java.util.ArrayList;
import java.util.List;

public class LeeCode_zhishu {
    public static void main(String[] args) {
        System.out.println(getzhishu(100000));
    }
    private static List<Integer> getzhishu(int n){
        List<Integer> ans = new ArrayList<>();
        ans.add(2);
        for (int j = 3; j < n; j++) {
            double pow = Math.pow(j, 0.5);
            boolean iszhi = true;
            for (int i = 2; i <= pow; i++) {
                if (j % i == 0){
                    iszhi = false;
                    break;
                }
            }
            if (iszhi)
                ans.add(j);
        }
        return ans;
    }
}
